//
//  GameCharacter.m
//  LearningCocos
//
//  Created by abyssos on 2014. 2. 25..
//  Copyright (c) 2014년 ainhan. All rights reserved.
//

#import "GameCharacter.h"

@implementation GameCharacter

@synthesize characterHealth;
@synthesize characterState;

- (void)dealloc {
    [super dealloc];
}

- (int)getWeaponDamage {
    CCLOG(@"getWeaponDamage should be overridden");
    return 0;
}

- (void)checkAndClampSpritePosition {
    CGPoint currentSpritePosition = [self position];
    
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        //Clamp for the iPad
        if(currentSpritePosition.x < 30.0f) {
            [self setPosition:ccp(30.0f, currentSpritePosition.y)];
        } else if(currentSpritePosition.x > 1000.0f) {
            [self setPosition:ccp(1000.0f, currentSpritePosition.y)];
        }
    } else {
        //Clamp for the iPhone
        if(currentSpritePosition.x < 24.0f) {
            [self setPosition:ccp(24.0f, currentSpritePosition.y)];
        } else if(currentSpritePosition.x > 456.0f) {
            [self setPosition:ccp(456.0f, currentSpritePosition.y)];
        }
    }
}

@end
